package de.dhbw.horb.inf2013.vierFarbenProblem.model.solver;

import java.awt.Color;

import de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes.Graph;
import de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes.IlligalGraphException;
import de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes.NoColorSetException;
import de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes.SolverListenerInterface;
import de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes.VertexNotSetException;

/**
 * The Interface FourColorSolver.
 */
public interface FourColorSolver extends Runnable {

	/**
	 * Solves the four color problem.
	 * It colors all vertexes of the graph and neighbours haven't the same color.
	 * 
	 * @return the graph
	 * @throws VertexNotSetException
	 *             the vertex not set exception
	 * @throws NoColorSetException
	 *             the no color set exception
	 * @throws IlligalGraphException
	 *             the illigal graph exception
	 */
	public Graph solve() throws VertexNotSetException, NoColorSetException,
			IlligalGraphException;

	/**
	 * Adds the color.
	 * 
	 * @param color
	 *            the color
	 */
	public void addColor(Color color);

	/**
	 * Adds the solver listener.
	 * 
	 * @param listener
	 *            the listener
	 */
	public void addSolverListener(SolverListenerInterface listener);

	/**
	 * Sets the graph.
	 * 
	 * @param graph
	 *            the new graph
	 */
	public void setGraph(Graph graph);

	/**
	 * Gets the graph.
	 * 
	 * @return the graph
	 */
	public Graph getGraph();
}
